package com.leyou.item.service;

import com.leyou.bo.SearchRequest;
import com.leyou.item.pojo.Spu;
import com.leyou.sms.pojo.Goods;
import com.leyou.common.pojo.PageResult;

import java.io.IOException;

public interface SearchService {
    /**
     * 构建商品
     * @param spu
     * @return
     * @throws IOException
     */
    public Goods buildGoods(Spu spu) throws Exception;

    /**
     * 插入或更新索引
     * @param id
     */
    public void createIndex(Long id) throws Exception;

    /**
     * 删除索引
     * @param id
     */
    public void deleteIndex(Long id) throws Exception;

    /**
     * 搜索商品
     * @param request
     */
    public PageResult<Goods> search(SearchRequest request);
}
